<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserNoticeTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user_notice', function (Blueprint $table) {
            $table->increments('id');
            $table->integer("user_id")->default(0)->comment("用户ID");
            $table->tinyInteger("type")->default(0)->comment("通知类型 1系统消息 2订单消息 3活动信息");
            $table->string("title",150)->default('')->comment("标题");
            $table->string("desc",200)->default('')->comment('消息简介');
            $table->string("content",500)->default('')->comment("消息内容");
            $table->string("url",150)->default('')->comment("跳转地址");
            $table->tinyInteger("is_read")->default(0)->comment("是否阅读");
            $table->dateTime("read_time")->comment("阅读时间");
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user_notice');
    }
}
